﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TheHeInfoDao
{
    public class TheheInfoDaoHelper
    {
        public static object QueryDb(Func<TheheInfoEntities, object> queryFunc)
        {
            object rs;
            try
            {
                using (var cnn = new TheheInfoEntities())
                {
                    cnn.Database.Connection.Open();
                    rs = queryFunc(cnn);
                }
            }
            catch (Exception ex)
            {
                rs = null;
            }

            return rs;
        }
    }
}
